//
//  PPAlbumTagModel.m
//
//
//  Created by Jinxiao on 9/11/16.
//
//

#import "PPAlbumTagModel.h"

@implementation PPAlbumTagModel

// Insert code here to add functionality to your managed object subclass
+ (instancetype)existingAlbumTagForTagID:(NSInteger)tagID {
    PPAlbumTagModel *tag = [self find:@{@"tagID" : @(tagID)}];

    if(tag == nil) {
        tag = [PPAlbumTagModel create];
        tag.tagID = @(tagID);
        [tag.managedObjectContext saveContext];
    }

    return tag;
}

@end
